﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Combat/Combat.master" AutoEventWireup="true" CodeFile="BrigadeList.aspx.cs" Inherits="Combat_BrigadeList" StylesheetTheme="Content" %>

<%@ Register src="../UserContral/ListPageContral.ascx" tagname="ListPageContral" tagprefix="uc1" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
<script language="javascript" type="text/javascript">   
    function Winopen(obj, obj2) {
        var ul = "Receive.aspx?TaskID=" + obj + "&TaskBrigadeID="+obj2;     
        var popwin = window.open(ul, 'newwindow', 'height=500, width=700, top=0,left=0, toolbar=no, menubar=no, scrollbars=no, resizable=no,location=no, status=no')
        popwin.moveTo((screen.width - 600) / 2, (screen.height - 400) / 2)
    }
</script>
<asp:GridView ID="UserGrid" runat="server" AutoGenerateColumns="False" 
        Caption="<span>待接收任务列表</span>" onrowdatabound="UserGrid_RowDataBound">
        <Columns>            
           <asp:TemplateField HeaderText="序号">
                <ItemStyle HorizontalAlign="Center" />
                <HeaderStyle Width="30px" />
                <ItemTemplate>
                    <asp:Label ID="ID" runat="server" ForeColor="#666666"></asp:Label>
                </ItemTemplate>
            </asp:TemplateField>     
            <asp:TemplateField HeaderText="任务标题">             
                <ItemTemplate>
                   <%# GetTaskTitle(Eval("TaskID"))%>
                </ItemTemplate>
            </asp:TemplateField>
            <asp:TemplateField HeaderText="下达日期">
              <ItemTemplate>
                   <%# GetTaskDate(Eval("TaskID"))%>
                </ItemTemplate>
            </asp:TemplateField>
            <asp:TemplateField HeaderStyle-Width="8%">               
                <ItemTemplate>
                    <asp:LinkButton ID="lnbtnReceive" OnCommand="lnbtnReceive_Command" CommandArgument='<%# Eval("ID") %>' CommandName='<%# Eval("TaskID") %>' runat="server">接收任务</asp:LinkButton>
                </ItemTemplate>
            </asp:TemplateField>            
        </Columns>
        <HeaderStyle HorizontalAlign="Left" />
    </asp:GridView>
    <asp:GridView ID="TaskList" runat="server" AutoGenerateColumns="False" 
        Caption="<span>已接收任务列表</span>" onrowdatabound="TaskList_RowDataBound">
        <Columns>            
           <asp:TemplateField HeaderText="序号">
                <ItemStyle HorizontalAlign="Center" />
                <HeaderStyle Width="30px" />
                <ItemTemplate>
                    <asp:Label ID="ID" runat="server" ForeColor="#666666"></asp:Label>
                </ItemTemplate>
            </asp:TemplateField>     
            <asp:TemplateField HeaderText="任务标题">             
                <ItemTemplate>
                   <%# GetTaskTitle(Eval("TaskID"))%>
                </ItemTemplate>
            </asp:TemplateField>
            <asp:TemplateField HeaderText="接收日期">               
                <ItemTemplate>
                   <%# DateTime.Parse(Eval("AcceptDate").ToString()).ToString("yyyy-MM-dd") %>
                </ItemTemplate>
            </asp:TemplateField>
           <asp:TemplateField HeaderStyle-Width="12%">               
                <ItemTemplate>
                  <%# bool.Parse(Eval("IsAccept").ToString())?"":"此任务已过期" %>
                    <asp:LinkButton ID="lnbtnReceive" OnCommand="lnbtnReceive_Command" Visible='<%# bool.Parse(Eval("IsAccept").ToString()) %>' CommandArgument='<%# Eval("ID") %>' CommandName='<%# Eval("TaskID") %>'  OnClientClick=<%# "Winopen('"+Eval("TaskID")+"','"+Eval("ID")+"')" %> runat="server"><%# GetText(Eval("ID"))%></asp:LinkButton>
                </ItemTemplate>
            </asp:TemplateField>
            
        </Columns>
        <HeaderStyle HorizontalAlign="Left" />
    </asp:GridView>
    <uc1:ListPageContral ID="ListPageContral1" OnPageSizeChange="ListPageContral1_PageSizeChange" PageSize="20"  runat="server" />
</asp:Content>

